<!-- 首页 -->
<template>
  <van-swipe class="my-swipe" :autoplay="4500" indicator-color="white">
    <van-swipe-item v-for="item in state.bannerList" :key="item.id">
      <van-image :src="item.image"></van-image>
    </van-swipe-item>
  </van-swipe>
</template>
<script setup>
import { onMounted, reactive, toRefs } from "vue";

import { useRoute, useRouter } from "vue-router";

import {
  GetBanner
} from "@/api/index.js"

import icon_hand from "@/assets/image/icon_hand2.png";
const route = useRoute();

const state = reactive({
  icon_hand,
  bannerList:[]
});

const router = useRouter();

const GetBannerData = async () => {
  let {data} = await GetBanner()
  state.bannerList = data
}

onMounted(() => {
  GetBannerData()
})
</script>



<style lang="scss" scoped>
.my-swipe{
  height: 230px;
}
</style>